package com.tsingtree.modular.model.result;

import com.tsingtree.modular.entity.NanPopupAdvertItem;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 弹窗广告主表
 * </p>
 *
 * @author jagger
 * @since 2025-10-22
 */
@Data
public class NanPopupAdvertResult implements Serializable {

    private static final long serialVersionUID = 1L;

    private Integer id;

    private Date createTime;

    private Date updateTime;

    private Integer version;

    private String name;

    private Integer type;

    private String deviceId;

    private String deviceName;

    private Integer status;

    private Integer sort;

    private BigDecimal delayHours;

    private Integer linkType;

    private String linkUrl;

    private Boolean isDel;

    // 广告内容项列表
    private List<NanPopupAdvertItem> items;

    // 类型字符串
    private String typeStr;

    // 状态字符串
    private String statusStr;

    public String getTypeStr() {
        if (type == null) {
            return "";
        }
        switch (type) {
            case 1:
                return "绑定设备后弹窗";
            case 2:
                return "即时弹窗";
            case 3:
                return "评论弹窗";
            case 4:
                return "注册时长";
            default:
                return "";
        }
    }

    public String getStatusStr() {
        if (status == null) {
            return "";
        }
        return status == 1 ? "启用" : "禁用";
    }

}

